<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of EaExcelPrinter
 *
 * @author EaDeveloper
 */
class EaExcelPrinter implements EasoftPrinter {

    public $db;

    public function write($report) {
        $fields = array();
        foreach ($report->fields as $f) {
            $fields[] = $f['name'];
        }
        $excel = new MysqlExcel();
        $excel->db = $this->db;
        $excel->ImportArray($report->lastResult, $fields, $report->label . ".xls", true);
    }

}

?>